package com.yyt.module_main.act;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.yyt.libsrc.bean.UpgradeOrderBean;
import com.yyt.libsrc.conf.Consts;
import com.yyt.libsrc.net.JavaParamsBuilder;
import com.yyt.libsrc.net.NetUtil;
import com.yyt.libsrc.net.SuccessCallback;
import com.yyt.libsrc.router.RouteTable;
import com.yyt.module_main.R;
import com.yyt.module_main.databinding.ActivityApplyPartnerBinding;
import com.yyt.module_main.vm.ApplyPartnerVM;

import top.lixb.libcommon.base.RefreshableActivity;

@Route(path = RouteTable.main_apply_partner)
public class ApplyPartnerActivity extends RefreshableActivity<ActivityApplyPartnerBinding> {

    private ApplyPartnerVM mVm;

    @Override
    protected void init() {
        mVm = new ApplyPartnerVM();
        mRefreshContentBinding.setVm(mVm);
        setTitle("合伙人");
    }

    @Override
    protected int initRefreshLayout() {
        return R.layout.activity_apply_partner;
    }

    @Override
    protected void getData(boolean refresh) {
        NetUtil.orderPost(new JavaParamsBuilder()
                .addCmd(Consts.CMD.upgradeOrder)
                .addP("level", String.valueOf(mVm.level.get()))
                .addP("payCardNo", mVm.payCardNo.get())
                .addP("bankCode", mVm.bankCode.get())
                .addP("cvn", mVm.cvn.get())
                .addP("expDate", mVm.expDate.get())
                .build(), new SuccessCallback<UpgradeOrderBean>() {
            @Override
            public void onSuccess(UpgradeOrderBean upgradeOrderBean) {

            }
        });
    }
}
